Cache modules are high-speed memories that facilitate fast retrieval of information including data and instructions. Typically, cache modules are relatively expensive and are characterized by a small size, especially in comparison to higher-level memory modules.
The performance of modern processor-based systems usually depends upon the cache module performances and especially upon the speed of a provision of an information unit that caused a cache miss. A cache hit occurs when an information unit that is requested is present in a cache module memory. A cache miss occurs when the requested information unit is not present in the cache module and has to be fetched from another memory module. This other memory module is also referred to as a higher-level memory module.
After being fetched from the higher level memory module the fetched information unit is written to the cache module and replaces a previously stored information unit. An information unit replacement scheme is responsive to the association level of the cache module. In fully associative cache module a fetched information unit can be written to any entry of the cache module. In a k-way cache a fetched information unit can be written to one out of k entries of the cache.
Cache ways can be temporarily locked such as to prevent a fetched information unit to be written to them. The locking can facilitate sharing information between tasks, but this is not necessarily so.
Once a cache miss occurs the information unit should be retrieved from the higher level memory module and be stored in the cache module as soon as possible. Accordingly, the selection of the cache way that will store the information unit should be completed in a relative short time period, even at the presence of one or more locked cache ways.